package com.supermali.system;

import com.supermali.util.WorldTransform;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;

public class ShowLabel {

    private static AffineTransform worldTransform =WorldTransform.getWorldAffineTransform() ;

    public static void showStr(Graphics g, String str, int x, int y){
        // 创建文字
        Point2D.Double aDouble = new Point2D.Double(x,y);
        Point2D transform = worldTransform.transform(aDouble, null);
        Font orignFont = g.getFont();
        Color orignColor = g.getColor();
        Font font = new Font("宋体", Font.BOLD, 16);
        g.setFont(font);
        g.setColor(Color.WHITE);
        g.drawString(str,(int)transform.getX(),(int)transform.getY());
        g.setFont(orignFont);
        g.setColor(orignColor);
    }
}
